<template>
	<view class="page">
		<!-- <u-navbar title="更换密码" :placeholder="true"   :autoBack="true" rightText="保存" @rightClick="rightClick"></u-navbar> -->
		<headerinfo></headerinfo>
		<!-- <headertop :inv="5"></headertop> -->
		<backos></backos>
		<view class="login_form">
			<view class="list">
				<view class="label ">原密码</view>
				<u--input type="text" fontSize="15" border="none" placeholder="请输入原密码"
					v-model="form.password"></u--input>
			</view>
			<view class="list">
				<view class="label ">新密码</view>
				<u--input type="text" fontSize="15" border="none" placeholder="请输入新密码"
					v-model="form.newPassword"></u--input>
			</view>

			<view class="list">
				<view class="label ">确认密码</view>
				<u--input type="text" fontSize="15" border="none" placeholder="请输入确认密码"
					v-model="form.newPassword2"></u--input>
			</view>
		</view>

		<view class="loginBtn main-bg-color" @click="rightClick">提 交</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					password: '',
					newPassword: '',
					newPassword2: '',
				},
			};
		},
		onLoad() {},
		methods: {
			rightClick() {
				if (this.form.password == '') {
					return this.$Show.show('原密码不能为空')
				}

				if (this.form.newPassword == '') {
					return this.$Show.show('新密码不能为空')
				}

				if (this.form.newPassword2 == '') {
					return this.$Show.show('确认密码不能为空')
				}

				this.$api.changePwd(this.form).then(res => {
					console.log(res)
					this.$Show.successJump('修改成功')
				})
			},

		}
	};
</script>

<style lang="scss">
	.login_form {
		background-color: #fff;
		margin-top: 30rpx;
		width: 600px;
		margin: 0 auto;
		box-shadow: 0 0 3px #ccc;
		border-radius: 10px;

		.list {
			display: flex;
			align-items: center;
			height: 90rpx;
			border-bottom: 1px solid #f8f8f8;
			position: relative;

			.label {
				width: 140rpx;
				text-align: right;
				margin-right: 20rpx;
			}

			.sendCode {
				position: absolute;
				right: 30rpx;
				top: 50%;
				transform: translateY(-50%);
				width: 180rpx;
				height: 60rpx;
			}
		}

		.list:last-child {
			border: none;
		}
	}

	.agree {
		display: flex;
		align-items: center;
		padding-left: 30rpx;
		margin: 30rpx 0;

		image {
			width: 45rpx;
			height: 45rpx;
			margin-right: 10rpx;
		}

		span {
			text-decoration: underline;
		}
	}

	.loginBtn {
		width: 690rpx;
		height: 80rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		margin: 0 auto;
		margin-top: 40rpx;
		border-radius: 10rpx;
		box-sizing: border-box;
	}
</style>